package com.yunze.iotapi.utils;

import com.github.pagehelper.PageInfo;
import com.yunze.common.constant.HttpStatus;
import com.yunze.common.core.page.TableDataInfo;

import java.util.List;

public class TabDatePageUtils {
    public TableDataInfo getDataInfo(List<?> list){
        TableDataInfo tableDataInfo = new TableDataInfo();
        tableDataInfo.setMsg(String.valueOf(HttpStatus.SUCCESS));
        tableDataInfo.setTotal(new PageInfo(list).getTotal());
        tableDataInfo.setRows(list);
        return tableDataInfo;
    }

    public TableDataInfo queryDataInfo(List<?> list){
        TableDataInfo tableDataInfo = new TableDataInfo();
        tableDataInfo.setMsg("成功");
        tableDataInfo.setTotal(new PageInfo(list).getTotal());
        tableDataInfo.setRows(list);
        return tableDataInfo;
    }
}
